/**
 * 获取当前时间  yyyy-mm-dd格式
 * @returns {string}
 */
export function getCurrentDateYYYY_MM_DD() {
  const now = new Date();
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

/**
 * 获取当前时间  yyyy-mm-dd hh:mm:ss格式
 * @returns {string}
 */
export function getCurrentDateTime_YYYY_MM_DD_HHMMSS() {
  const now = new Date();
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  const hours = String(now.getHours()).padStart(2, '0');
  const minutes = String(now.getMinutes()).padStart(2, '0');
  const seconds = String(now.getSeconds()).padStart(2, '0');

  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}

/**
 * 判断value是不是数字
 * @returns {Boolean}
 */
export function isNumeric(value) {
  return !isNaN(value) && // 判断是否不是NaN
    value !== null && // 判断是否不是null
    typeof value !== 'undefined'; // 判断是否不是undefined
}

